﻿using System;
using System.Collections.Generic;

public class PlayerGroundHFSM : PlayerBaseHFSM {
	public PlayerGroundHFSM(PlayerController controller, PlayerStateEnum stateName, State<PlayerStateEnum> superFSM, StateFactory<PlayerStateEnum> factory) : base(controller, stateName, superFSM, factory) {
		AddConditionToSelf(() => controller.IsOnGround);

		AddNewTransition(PlayerStateEnum.AirHFSM, () => (controller.Jump && !controller.IsTouchCeiling) || !controller.IsOnGround);
		AddNewTransition(PlayerStateEnum.GroundATKHFSM, () => AtkInput && !(controller.DownInput || controller.IsTouchCeiling));
		//AddNewTransition(wall)
		//AddNewTransition(groundatk)
	}
	public override void Enter() {
		base.Enter();
		ResetJumpCnt();
	}

	void ResetJumpCnt() => _controller.StateData.CurJumpCnt = 0;
	bool AtkInput => _controller.HandWeaponInput || _controller.TickInput || _controller.BowInput;

}